Skip to content

Add optional week-aligned calendar view with selectable week start (#538)#1330

Open
TemujinCalidius wants to merge 2 commits into
TheBoredTeam:devfrom
TemujinCalidius:feature/calendar-week-start
Open

Add optional week-aligned calendar view with selectable week start (#538)#1330
TemujinCalidius wants to merge 2 commits into
TheBoredTeam:devfrom
TemujinCalidius:feature/calendar-week-start

Conversation

@TemujinCalidius

Copy link
Copy Markdown

Summary

Adds an opt-in weekly view for the mini calendar that shows one week at a time, aligned to a user-chosen first weekday — addressing the request in #538 to control which day the week starts on.

The existing scrolling day dial remains the default, so current behaviour is unchanged unless the user opts in.

What's new

  • Settings → Calendar → "Weekly view" toggle. When on, the calendar shows a fixed 7-day strip starting on the chosen weekday, with ‹ › chevrons; the scroll wheel and chevrons page a whole week.
  • "Week starts on" picker (System default / Sunday / Monday), shown only when Weekly view is enabled.

Implementation notes

  • New WeekStartDay enum (firstWeekday resolved via Calendar.firstWeekday; system follows the OS) and two defaults: calendarWeekView (Bool, default false) and weekStartDay (default .system).
  • New WeekStripPicker view; CalendarView switches between the original dial and the week strip on the toggle. The dial code path is unchanged.
  • Weekday symbols use the locale-aware Calendar.veryShortWeekdaySymbols; week boundaries use Calendar.dateInterval(of: .weekOfYear:) so they honour firstWeekday and are DST-safe.
  • Option labels are keyed by their English text so untranslated locales fall back to readable English rather than raw string keys.
  • While here, tidied the scroll-wheel NSEvent local-monitor lifecycle in both pickers (store the token, remove it on .onDisappear) — the dial previously added a monitor on every appear without removing it.

Testing

  • Builds clean (xcodebuild, Debug, macOS).
  • Verified on a real notch: default dial unchanged; toggling Weekly view switches live; Sunday/Monday/System re-align the strip; wheel + chevrons page exactly one week; selecting a day updates the event list.

UI change — a short screen recording of the dial ↔ weekly toggle will be added.

Closes #538

Adds an opt-in weekly view for the mini calendar that shows one week at a
time, aligned to a user-chosen first weekday (System / Sunday / Monday).

The scrolling day dial remains the default. A new "Weekly view" toggle in
Calendar settings switches to a fixed 7-day strip with ‹ › chevrons; the
scroll wheel and chevrons page a whole week. A "Week starts on" picker is
shown only when weekly view is enabled.

- New WeekStartDay enum and calendarWeekView / weekStartDay defaults
- WeekStripPicker view; CalendarView switches dial <-> week on the toggle
- Option labels keyed by English text so untranslated locales fall back to
  readable English instead of raw keys
- Tidy the scroll-wheel NSEvent monitor lifecycle in both pickers (store
  the token, remove it on disappear)

Relates to TheBoredTeam#538

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TemujinCalidius

TemujinCalidius commented Jun 17, 2026

Copy link
Copy Markdown
Author

Screen Recording - https://makertube.net/w/nycMp9YcooEpYENK6r8U64

@Alexander5015

Copy link
Copy Markdown
Member

Can you modify it so that scrolling still changes the selected date without changing the week alignment until the user scrolls outside of the bounds of the current window, and then it changes? (It would also be good to animate this transition, just for scrolling)

Comment thread boringNotch/Localizable.xcstrings Outdated
Comment thread boringNotch/components/Settings/Views/CalendarSettingsView.swift
…week scroll

Maintainer review on the week-aligned calendar:

- Week starts on: offer all seven weekdays plus a "System Setting (X)" option
  that shows the resolved system first weekday in parentheses, mirroring the
  macOS Calendar app. Weekday names now come from Calendar.weekdaySymbols
  (Apple-provided localization) instead of custom "Monday"/"Sunday" strings.
- Week strip scrolling now moves the selection one day at a time and keeps the
  week aligned until the selection leaves it; crossing the boundary slides the
  whole week. Reuses the app's existing withAnimation (no new animation): the
  highlight glides between days, and the week flips with a contained .push
  transition clipped to the calendar column.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@TemujinCalidius

Copy link
Copy Markdown
Author

Thanks for the review, @Alexander5015! Pushed updates addressing all three points:

  1. Built-in day localization — the "Week starts on" options now use the system's localized weekday names via Calendar.weekdaySymbols (Apple-provided) instead of custom Monday/Sunday string keys.
  2. Apple Calendar–style picker — the default System Setting (X) option shows the resolved system first weekday in parentheses, and you can now pick any day of the week (Sunday–Saturday).
  3. Scroll behaviour — scrolling now moves the selected date one day at a time while keeping the week aligned; once the selection leaves the visible week it shifts by one. It reuses the app's existing withAnimation (no new animation): the selection glides between days, and the week flip is a contained .push slide clipped to the calendar column.

Updated screen recording: https://makertube.net/w/t2vtaqLEHuuSJNYF68F69p

Ready for another look whenever you have time 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants